package com.qizhou.base.dialog.lifecycledialog.cancelable

import androidx.lifecycle.LifecycleOwner
import androidx.fragment.app.DialogFragment
import android.view.KeyEvent.KEYCODE_BACK


class CanNotCancelHandler(dialogFragment: DialogFragment): BaseCancelableHandler(dialogFragment) {

    override fun onResume(owner: LifecycleOwner) {
        super.onResume(owner)
        dialogFragment.dialog!!.setCanceledOnTouchOutside(false)
        dialogFragment.dialog!!.setOnKeyListener { v, keyCode, event -> keyCode == KEYCODE_BACK }
    }

}